package com.yijiaw.domain;

import java.io.Serializable;

import java.lang.StringBuilder;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;

import javax.xml.bind.annotation.*;

import javax.persistence.*;

/**
 */

@Entity
@NamedQueries({
		@NamedQuery(name = "findAllUss", query = "select myUs from Us myUs"),
		@NamedQuery(name = "findUsByAddress", query = "select myUs from Us myUs where myUs.address = ?1"),
		@NamedQuery(name = "findUsByAddressContaining", query = "select myUs from Us myUs where myUs.address like ?1"),
		@NamedQuery(name = "findUsByContact", query = "select myUs from Us myUs where myUs.contact = ?1"),
		@NamedQuery(name = "findUsByContactContaining", query = "select myUs from Us myUs where myUs.contact like ?1"),
		@NamedQuery(name = "findUsByEmail", query = "select myUs from Us myUs where myUs.email = ?1"),
		@NamedQuery(name = "findUsByEmailContaining", query = "select myUs from Us myUs where myUs.email like ?1"),
		@NamedQuery(name = "findUsByFax", query = "select myUs from Us myUs where myUs.fax = ?1"),
		@NamedQuery(name = "findUsByFaxContaining", query = "select myUs from Us myUs where myUs.fax like ?1"),
		@NamedQuery(name = "findUsById", query = "select myUs from Us myUs where myUs.id = ?1"),
		@NamedQuery(name = "findUsByName", query = "select myUs from Us myUs where myUs.name = ?1"),
		@NamedQuery(name = "findUsByNameContaining", query = "select myUs from Us myUs where myUs.name like ?1"),
		@NamedQuery(name = "findUsByPhone", query = "select myUs from Us myUs where myUs.phone = ?1"),
		@NamedQuery(name = "findUsByPhoneContaining", query = "select myUs from Us myUs where myUs.phone like ?1"),
		@NamedQuery(name = "findUsByPrimaryKey", query = "select myUs from Us myUs where myUs.id = ?1") })
@Table(catalog = "yijiaw", name = "us")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(namespace = "temp/com/yijiaw/domain", name = "Us")
public class Us implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 */
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", nullable = false)
	@Basic(fetch = FetchType.EAGER)
	@Id
	@XmlElement
	Integer id;
	/**
	 */

	@Column(name = "name", length = 60)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String name;
	/**
	 */

	@Column(name = "phone", length = 20)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String phone;
	/**
	 */

	@Column(name = "address", length = 150)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String address;
	/**
	 */

	@Column(name = "fax", length = 20)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String fax;
	/**
	 */

	@Column(name = "contact", length = 30)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String contact;
	/**
	 */

	@Column(name = "email", length = 50)
	@Basic(fetch = FetchType.EAGER)
	@XmlElement
	String email;

	/**
	 */
	public void setId(Integer id) {
		this.id = id;
	}

	/**
	 */
	public Integer getId() {
		return this.id;
	}

	/**
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 */
	public String getName() {
		return this.name;
	}

	/**
	 */
	public void setPhone(String phone) {
		this.phone = phone;
	}

	/**
	 */
	public String getPhone() {
		return this.phone;
	}

	/**
	 */
	public void setAddress(String address) {
		this.address = address;
	}

	/**
	 */
	public String getAddress() {
		return this.address;
	}

	/**
	 */
	public void setFax(String fax) {
		this.fax = fax;
	}

	/**
	 */
	public String getFax() {
		return this.fax;
	}

	/**
	 */
	public void setContact(String contact) {
		this.contact = contact;
	}

	/**
	 */
	public String getContact() {
		return this.contact;
	}

	/**
	 */
	public void setEmail(String email) {
		this.email = email;
	}

	/**
	 */
	public String getEmail() {
		return this.email;
	}

	/**
	 */
	public Us() {
	}

	/**
	 * Copies the contents of the specified bean into this bean.
	 *
	 */
	public void copy(Us that) {
		setId(that.getId());
		setName(that.getName());
		setPhone(that.getPhone());
		setAddress(that.getAddress());
		setFax(that.getFax());
		setContact(that.getContact());
		setEmail(that.getEmail());
	}

	/**
	 * Returns a textual representation of a bean.
	 *
	 */
	public String toString() {

		StringBuilder buffer = new StringBuilder();

		buffer.append("id=[").append(id).append("] ");
		buffer.append("name=[").append(name).append("] ");
		buffer.append("phone=[").append(phone).append("] ");
		buffer.append("address=[").append(address).append("] ");
		buffer.append("fax=[").append(fax).append("] ");
		buffer.append("contact=[").append(contact).append("] ");
		buffer.append("email=[").append(email).append("] ");

		return buffer.toString();
	}

	/**
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = (int) (prime * result + ((id == null) ? 0 : id.hashCode()));
		return result;
	}

	/**
	 */
	public boolean equals(Object obj) {
		if (obj == this)
			return true;
		if (!(obj instanceof Us))
			return false;
		Us equalCheck = (Us) obj;
		if ((id == null && equalCheck.id != null) || (id != null && equalCheck.id == null))
			return false;
		if (id != null && !id.equals(equalCheck.id))
			return false;
		return true;
	}
}
